package com.tsinghuabigdata.edu.ddmath.module.neteaseim;

import com.netease.nimlib.sdk.StatusBarNotificationConfig;
import com.netease.nimlib.sdk.auth.LoginInfo;
import com.tsinghuabigdata.edu.ddmath.commons.AppSessionCache;

public class NeteaseAccountUtils {

    public static void setStatusbarNotifyConfig(StatusBarNotificationConfig config) {
        AppSessionCache.getInstance().put(NeteaseConst.STATUSBAR_NOTIFY_CONFIG, config);
    }


    public static StatusBarNotificationConfig getStatusbarNotifyConfig() {
        return AppSessionCache.getInstance().get(NeteaseConst.STATUSBAR_NOTIFY_CONFIG);
    }

    public static LoginInfo getNeteaseLoginInfo() {
        return AppSessionCache.getInstance().get(NeteaseConst.NETEASE_LOGININFO);
    }

    public static void setNeteaseLoginInfo(LoginInfo loginInfo) {
        AppSessionCache.getInstance().put(NeteaseConst.NETEASE_LOGININFO, loginInfo);
    }

    /**
     * 清空
     */
    public static void clear() {
        // 删除登录信息
        AppSessionCache.getInstance().remove(NeteaseConst.NETEASE_LOGININFO);
//        // 删除笔序列号
//        AppSessionCache.getInstance().remove(AppConst.SESSION_SERIAL_NUMS);
//        // 删除学生信息
//        AppSessionCache.getInstance().remove(AppConst.SESSION_STUDENT_INFO);
    }
}
